<!DOCTYPE html>
<html>
<head>
    <title>DOM Level 2 Event Handler Example</title>
</head>
<body>
    <input type="button" id="myBtn" value="Click Me" />
    <p>This example won't work in Internet Explorer.</p>
    <script type="text/javascript">
        var btn = document.getElementById("myBtn");
        btn.addEventListener("click", function(){
            alert(this.id);
        }, false);
        btn.addEventListener("click", function(){
            alert("Hello world!");
        }, false);

    </script>
</body>
</html>
